package com.jiayi.data.converter;

import java.util.Date;

import com.jiayi.data.entity.schema.JiayiProductType;
import com.jiayi.data.entity.excel.JiayiProductTypeExcel;
import com.jiayi.data.entity.bo.JiayiProductTypeBO;
import com.jiayi.data.entity.request.JiayiProductTypeRequest;
import com.jiayi.data.entity.request.JiayiProductTypeSearchRequest;
import com.jiayi.data.entity.request.JiayiProductTypeSearchPageRequest;
import com.jiayi.data.entity.response.JiayiProductTypeDTO;
import org.springframework.stereotype.Component;

/**
 * 产品展示类型对象 Converter
 *
 * @author zzx
 * @date 2024-11-26
 */
@Component
public class JiayiProductTypeConverter {

    public JiayiProductType convertToJiayiProductType(JiayiProductTypeBO from) {
        if (from == null) {
            return null;
        }
        JiayiProductType to = new JiayiProductType();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeBO convertToJiayiProductTypeBO(JiayiProductTypeSearchRequest from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeBO to = new JiayiProductTypeBO();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeBO convertToJiayiProductTypeBO(JiayiProductTypeRequest from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeBO to = new JiayiProductTypeBO();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeBO convertToJiayiProductTypeBO(JiayiProductType from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeBO to = new JiayiProductTypeBO();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductType convertToJiayiProductType(JiayiProductTypeRequest from) {
        if (from == null) {
            return null;
        }
        JiayiProductType to = new JiayiProductType();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductType convertToJiayiProductType(JiayiProductTypeSearchPageRequest from) {
        if (from == null) {
            return null;
        }
        JiayiProductType to = new JiayiProductType();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductType convertToJiayiProductType(JiayiProductTypeSearchRequest from) {
        if (from == null) {
            return null;
        }
        JiayiProductType to = new JiayiProductType();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeDTO convertToJiayiProductTypeDTO(JiayiProductTypeBO from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeDTO to = new JiayiProductTypeDTO();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeDTO convertToJiayiProductTypeDTO(JiayiProductType from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeDTO to = new JiayiProductTypeDTO();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }

    public JiayiProductTypeExcel convertToJiayiProductTypeExcel(JiayiProductType from) {
        if (from == null) {
            return null;
        }
        JiayiProductTypeExcel to = new JiayiProductTypeExcel();
        to.setId(from.getId());
        to.setParentId(from.getParentId());
        to.setAncestor(from.getAncestor());
        to.setName(from.getName());
        to.setPoster(from.getPoster());
        to.setRemark(from.getRemark());
        to.setCreateBy(from.getCreateBy());
        to.setCreateTime(from.getCreateTime());
        return to;
    }


}